package com.iwdnb.gkgz.application.event;

import com.iwdnb.bmnf.common.eventbus.EventHandler;
import com.iwdnb.gkgz.application.model.request.AddStrategyTradeStockDataRequest;
import com.iwdnb.gkgz.application.strategy.StockBackValidateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class StockBackValidateEventHandler implements EventHandler<AddStrategyTradeStockDataRequest> {
    public static final String EVENT_TOPIC = "stockBackValidate";
    @Autowired
    private StockBackValidateService stockBackValidateService;

    @Override
    public String topic() {
        return EVENT_TOPIC;
    }

    @Override
    public void onMessage(AddStrategyTradeStockDataRequest request) {
        stockBackValidateService.doAllBackValidate(request);
    }
}
